package cn.edu.scau.cmi.lishuoxin.client.experiment1;
	
import java.util.ArrayList;

import cn.edu.scau.cmi.lishuoxin.interProgramming.experiment1.Animal;
import cn.edu.scau.cmi.lishuoxin.interProgramming.experiment1.Cat;
import cn.edu.scau.cmi.lishuoxin.interProgramming.experiment1.Dog;
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;


public class InterfaceMain extends Application {
	
	@Override
	public void start(Stage primaryStage) {
		ArrayList<Animal> animals = new ArrayList<>();
		animals.add(new Dog());
		animals.add(new Cat());
		
		
		try {
			VBox root = new VBox();
			for(int i = 0; i < animals.size(); i++) {
				root.getChildren().add(new Text(animals.get(i).say()));
				root.getChildren().add(new Text(animals.get(i).eat()));
			}
			Scene scene = new Scene(root,300,200);
			primaryStage.setTitle("动物");
			primaryStage.setScene(scene);
			primaryStage.show();
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		launch(args);
		
	}
}
